-- Sets up the plugin's main table --
Hyperion.Plugin = { }

-- Sets up the plugin's details --
Hyperion.Plugin.Name = "Chat Commands" -- The name of the plugin
Hyperion.Plugin.Author = "Jocken" -- The author of the plugin
Hyperion.Plugin.Version = "1.0" -- The version of the plugin
Hyperion.Plugin.Description = "Adds several useful chat commands" -- The description of the plugin

-- Initializes the plugin --
function Hyperion.Plugin.Initialize()
end

-- Adds a chat command that lets the player use the OOC chat --
Hyperion.ChatCommands[ "//" ] = function( ply, args, text )
	Hyperion.OOCTalk( "[OOC] " .. ply:Nick() .. ": " .. text )
end
Hyperion.ChatCommands[ "/ooc" ] = Hyperion.ChatCommands[ "//" ]
Hyperion.ChatCommands[ "/OOC" ] = Hyperion.ChatCommands[ "//" ]
Hyperion.ChatCommands[ "((" ] = Hyperion.ChatCommands[ "//" ]

-- Adds a chat command that lets the player use the local OOC chat --
Hyperion.ChatCommands[ ".//" ] = function( ply, args, text )
	Hyperion.ICTalk( "[LOOC] " .. ply:Nick() .. ": " .. text, ply:GetPos(), 250 )
end
Hyperion.ChatCommands[ "/looc" ] = Hyperion.ChatCommands[ ".//" ]
Hyperion.ChatCommands[ "/LOOC" ] = Hyperion.ChatCommands[ ".//" ]
Hyperion.ChatCommands[ "[[" ] = Hyperion.ChatCommands[ ".//" ]

-- Adds a chat command that lets the player yell IC --
Hyperion.ChatCommands[ "/y" ] = function( ply, args, text )
	Hyperion.ICTalk( ply:Nick() .. " yells: " .. text, ply:GetPos(), 450 )
end
Hyperion.ChatCommands[ "/Y" ] = Hyperion.ChatCommands[ "/y" ]
Hyperion.ChatCommands[ "/yell" ] = Hyperion.ChatCommands[ "/y" ]
Hyperion.ChatCommands[ "/YELL" ] = Hyperion.ChatCommands[ "/y" ]

-- Adds a chat command that lets the player whisper IC --
Hyperion.ChatCommands[ "/w" ] = function( ply, args, text )
	Hyperion.ICTalk( ply:Nick() .. " whispers: " .. text, ply:GetPos(), 100 )
end
Hyperion.ChatCommands[ "/W" ] = Hyperion.ChatCommands[ "/w" ]
Hyperion.ChatCommands[ "/whisper" ] = Hyperion.ChatCommands[ "/w" ]
Hyperion.ChatCommands[ "/WHISPER" ] = Hyperion.ChatCommands[ "/w" ]

-- Adds a chat command that lets the player decide an action --
Hyperion.ChatCommands[ "/it" ] = function( ply, args, text )
	Hyperion.ICTalk( text, ply:GetPos(), 250 )
end
Hyperion.ChatCommands[ "/IT" ] = Hyperion.ChatCommands[ "/it" ]
Hyperion.ChatCommands[ "/action" ] = Hyperion.ChatCommands[ "/it" ]
Hyperion.ChatCommands[ "/ACTION" ] = Hyperion.ChatCommands[ "/it" ]

-- Adds a chat command that lets the player perform an action --
Hyperion.ChatCommands[ "/me" ] = function( ply, args, text )
	Hyperion.ICTalk( ply:Nick() .. " " .. text, ply:GetPos(), 250 )
end
Hyperion.ChatCommands[ "/ME" ] = Hyperion.ChatCommands[ "/me" ]
Hyperion.ChatCommands[ "/perform" ] = Hyperion.ChatCommands[ "/me" ]
Hyperion.ChatCommands[ "/PERFORM" ] = Hyperion.ChatCommands[ "/me" ]

-- Adds a chat command that lets admins create events --
Hyperion.ChatCommands[ "/event" ] = function( ply, args, text )
	if ( !ply:IsAdmin() ) then
		return
	end

	-- NOTE: Even though this is technically an IC command, we still want to send it to all players --
	Hyperion.OOCTalk( "[EVENT] " .. text )
end
Hyperion.ChatCommands[ "/EVENT" ] = Hyperion.ChatCommands[ "/event" ]
Hyperion.ChatCommands[ "/ev" ] = Hyperion.ChatCommands[ "/event" ]
Hyperion.ChatCommands[ "/EV" ] = Hyperion.ChatCommands[ "/event" ]
Hyperion.ChatCommands[ "/e" ] = Hyperion.ChatCommands[ "/event" ]
Hyperion.ChatCommands[ "/E" ] = Hyperion.ChatCommands[ "/event" ]

-- Registers the plugin --
Hyperion.Plugins.Register( Hyperion.Plugin )